//
//  PresidentsTableViewController.m
//  11210
//
//  Created by student on 16/3/7.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "PresidentsTableViewController.h"

@interface PresidentsTableViewController ()
@property (weak, nonatomic) IBOutlet UITextField *nametext;
@property (weak, nonatomic) IBOutlet UITextField *fromtext;
@property (weak, nonatomic) IBOutlet UITextField *totext;
@property (weak, nonatomic) IBOutlet UITextField *partytext;

@end

@implementation PresidentsTableViewController
- (IBAction)pressed:(id)sender
{
    self.pre.name=self.nametext.text;
    self.pre.fromYear=self.fromtext.text;
    self.pre.toYear=self.totext.text;
    self.pre.party=self.partytext.text;
    [self.navigationController popViewControllerAnimated:YES];
    [self.delegate refresh];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    self.nametext.text=self.pre.name;
    self.fromtext.text=self.pre.fromYear;
    self.totext.text=self.pre.toYear;
    self.partytext.text=self.pre.party;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
